package com.aidex.biz.service.impl;

import java.util.List;
import com.aidex.common.annotation.DataScope;
import com.github.pagehelper.PageInfo;
import com.aidex.common.core.domain.entity.SysUser;
import com.aidex.common.core.domain.entity.SysDept;
import com.aidex.common.core.service.BaseServiceImpl;
import com.aidex.framework.cache.DeptUtils;
import com.aidex.framework.cache.UserUtils;
import org.springframework.stereotype.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.aidex.biz.mapper.AppointmentCompanyMapper;
import com.aidex.biz.domain.AppointmentCompany;
import com.aidex.biz.service.AppointmentCompanyService;
import org.springframework.transaction.annotation.Transactional;
import com.aidex.common.utils.NumberUtils;

/**
 * 企业上门回收Service业务层处理
 * @author sean
 * @email 2074844820@qq.com
 * @date 2022-11-22
 */
@Service
@Transactional(readOnly = true)
public class AppointmentCompanyServiceImpl extends BaseServiceImpl<AppointmentCompanyMapper, AppointmentCompany> implements AppointmentCompanyService
{
    private static final Logger log = LoggerFactory.getLogger(AppointmentCompanyServiceImpl.class);

    /**
     * 获取单条数据
     * @param appointmentCompany 企业上门回收
     * @return 企业上门回收
     */
    @Override
    public AppointmentCompany get(AppointmentCompany appointmentCompany)
    {
        AppointmentCompany dto = super.get(appointmentCompany);
        return dto;
    }

    /**
     * 获取单条数据
     * @param id 企业上门回收id
     * @return 企业上门回收
     */
    @Override
    public AppointmentCompany get(String id)
    {
        AppointmentCompany dto = super.get(id);
        return dto;
    }


    /**
     * 查询企业上门回收列表
     * @param appointmentCompany 企业上门回收
     * @return 企业上门回收
     */
    @Override
    @DataScope(userAlias = "a",deptAlias = "a")
    public List<AppointmentCompany> findList(AppointmentCompany appointmentCompany)
    {
        return super.findList(appointmentCompany);
    }

    /**
     * 分页查询企业上门回收列表
     * @param appointmentCompany 企业上门回收
     * @return 企业上门回收
     */
    @Override
    @DataScope(userAlias = "a",deptAlias = "a")
    public PageInfo<AppointmentCompany> findPage(AppointmentCompany appointmentCompany)
    {
        return super.findPage(appointmentCompany);
    }

    /**
     * 保存企业上门回收
     * @param appointmentCompany
     * @return 结果
     */
    @Override
    public boolean save(AppointmentCompany appointmentCompany)
    {
        return super.save(appointmentCompany);
    }


    /**
     * 删除企业上门回收信息
     * @param appointmentCompany
     * @return 结果
     */
    @Override
    public boolean remove(AppointmentCompany appointmentCompany)
    {
        return super.remove(appointmentCompany);
    }

    /**
     * 批量删除企业上门回收
     * @param ids 需要删除的企业上门回收ID
     * @return 结果
     */
    @Transactional(readOnly = false)
    @Override
    public int deleteAppointmentCompanyByIds(String[] ids)
    {
        return mapper.deleteAppointmentCompanyByIds(ids);
    }

    /**
     * 获取最大编号
     * @param appointmentCompany 企业上门回收
     * @return 结果
     */
    @Override
    public int findMaxSort(AppointmentCompany appointmentCompany)
    {
        return NumberUtils.nextOrder(mapper.findMaxSort(appointmentCompany));
    }
}
